package mia.beans;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import mia.dao.UserEntityDAO;
import mia.entity.UserEntity;

@ManagedBean(name="searchUsersBean")
@RequestScoped
public class SearchUsersBean {

	private String loginLike;
	private String firstNameLike;
	private String lastNameLike;
	private String emailLike;
	private String phoneLike;
	
	private UserEntity selectedUser;
	
	public List<UserEntity> getUsersFromSearch()
	{
		return UserEntityDAO.searchUsers(loginLike, firstNameLike, lastNameLike, emailLike, phoneLike);
	}
	
	public String getLoginLike() {
		return loginLike;
	}
	public void setLoginLike(String loginLike) {
		this.loginLike = loginLike;
	}
	
	public String getFirstNameLike() {
		return firstNameLike;
	}

	public void setFirstNameLike(String firstNameLike) {
		this.firstNameLike = firstNameLike;
	}

	public String getLastNameLike() {
		return lastNameLike;
	}

	public void setLastNameLike(String lastNameLike) {
		this.lastNameLike = lastNameLike;
	}

	public String getEmailLike() {
		return emailLike;
	}
	public void setEmailLike(String emailLike) {
		this.emailLike = emailLike;
	}
	public String getPhoneLike() {
		return phoneLike;
	}
	public void setPhoneLike(String phoneLike) {
		this.phoneLike = phoneLike;
	}
	public UserEntity getSelectedUser() {
		return selectedUser;
	}
	public void setSelectedUser(UserEntity selectedUser) {
		this.selectedUser = selectedUser;
	}

}
